package com.websocket.service;

import java.security.Principal;
import java.util.HashMap;
import java.util.Map;

public class Attachment {
    private Principal principal;
    private final Map<String, Object> attributes = new HashMap<>();

    public Attachment(Principal principal) {
        this.principal = principal;
    }

    public Principal getPrincipal() {
        return principal;
    }

    public void setPrincipal(Principal principal) {
        this.principal = principal;
    }

    public Object getAttribute(String key) {
        return this.attributes.get(key);
    }

    public void putAttribute(String key, Object value) {
        this.attributes.put(key, value);
    }
}
